package com.lagou.vo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author: wudong
 * @create: 2021-08-03 22:25
 **/
public class UserMatchInfo {
    private UserInfo loginInfo;
    private MachineStatus machineStatus;

    public static UserMatchInfo buildFromSession(HttpSession session, HttpServletRequest request){
        MachineStatus machineStatus = MachineStatus.build(request, session);
        UserInfo userInfo = UserInfo.buildFromSession(session);

        UserMatchInfo userMatchInfo = new UserMatchInfo();
        userMatchInfo.setLoginInfo(userInfo);
        userMatchInfo.setMachineStatus(machineStatus);

        return userMatchInfo;
    }

    public UserInfo getLoginInfo() {
        return loginInfo;
    }

    public void setLoginInfo(UserInfo loginInfo) {
        this.loginInfo = loginInfo;
    }

    public MachineStatus getMachineStatus() {
        return machineStatus;
    }

    public void setMachineStatus(MachineStatus machineStatus) {
        this.machineStatus = machineStatus;
    }

}
